<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/yy-1_0.tld" prefix="yy"%>
<%@ page import="westh.config.*"%>
<%
if (session.getAttribute("UserBO") != null) {session.invalidate();}
%>
<c:set var="pageTitleLocal" value="${AppName}'s user login" />
<yy:footprint pageTitle="${pageTitleLocal}" />
<html>
<head>
  <title>${pageTitleLocal}</title>
  <base href="${AppURL}/${AppContext}/" />
  <link href="../css/common.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="../js/prototype.js"></script>
  <c:remove var="userBO" scope="session" />
  <c:if test="${!empty info}">
    <script language="javascript">alert("${info}");</script>
  </c:if>
</head>

<body >
  <table width="100%" height="550"><tr><td align="center" valign="middle">

    <table border="0" width="100%">
       <tr>
        <td align="center"><h1>${AppName}</h1><br/><br/></td>
       </tr>
    </table>
    
    <form name="LoginForm" method="post" action="../login.do" target="_parent">
      <table border="0">
        <tr valign="top">
          <td>User Name</td>
          <td> <input type="text" name="nameLogin" style="width=80px" value=""/></td>
        </tr>
        <tr valign="top">
          <td>Password</td>
          <td> <input type="password" name="passwd" style="width=80px" value=""/></td>
        </tr>
        <tr>
        	<td />
          <td align="center">
            <input type="submit" value="Login"/>&nbsp;&nbsp;
            <input type="button" value="Apply" onclick="javascript:self.location='../access/user/register.jsp'" />
          </td>
        </tr>
      </table>
    </form>
<script language="javascript" type="text/javascript">
function getSumAllResponse(req){
  document.getElementById('sumAll').innerHTML=req.responseText;
}
var url = "../getSumAll.do?&<%=java.lang.Math.random()%>";
var ajaxSumAll=new Ajax.Request(url,{method: 'get',
  onComplete: getSumAllResponse}
);
function getSumYesterdayResponse(req){
  document.getElementById('sumYesterday').innerHTML="<font color='red'>"+req.responseText+"</font>";
}
var url = "../getSumYesterday.do?&<%=java.lang.Math.random()%>";
var ajaxSumYesterday=new Ajax.Request(url,{method: 'get',
  onComplete: getSumYesterdayResponse}
);
function getSumTodayResponse(req){
  document.getElementById('sumToday').innerHTML="<font color='red'>"+req.responseText+"</font>";
}
var url = "../getSumToday.do?&<%=java.lang.Math.random()%>";
var ajaxSumToday=new Ajax.Request(url,{method: 'get',
  onComplete: getSumTodayResponse}
);
</script>

    
    <table border="0" width="100%">
       <tr>
        <td align="center"> Visited:<span id="sumAll"></span>;
                            Yesterday:<span id="sumYesterday"></span>;
                            today:<span id="sumToday"></span> <br/>
                            <a href="../access/clickstream/" target="_blank">System Status</a><br/>
                            ${AppContact}</td>
       </tr>
    </table>

  </td></tr></table>
</body>
</html>
